import Clipboard from 'clipboard';
// import { ElMessage } from 'element-plus';

export default function handleClipboard(text: string, event: any) {
  const clipboard = new Clipboard(event.target, {
    text: () => text,
  });
  clipboard.on('success', () => {
    // clipboardSuccess()
    clipboard.destroy();
  });
  clipboard.on('error', () => {
    // clipboardError()
    clipboard.destroy();
  });
  // @ts-ignore
  clipboard.onClick(event);
}
